import http from "../../utils/request.js";


// 获取团队信息
export function getTeamInfo({
	id,
	currentPage,
	showCount,
}) {
	return http.$post('team/getTeam', {
		team_id: String(id),
		currentPage,
		showCount,
	})
}


//  搜索团队
export function search(query_str) {
	return http.$post('team/getTeamList', {
		query_str
	})
}

//  加入团队
export function joinTeam(target_id) {
	return http.$post('team/applyTeam', {
		target_id,

	})
}
//  获取团队成员
export function getTeamMember({
	team_id,
	currentPage,
	showCount,
}) {
	return http.$post('team/getTeamMember', {
		team_id,
		currentPage,
		showCount,
	})
}

//  获取团队 档期
export function getTeamScheduleInfo({
	team_id,
	currentPage,
	showCount,
	date,
}) {
	return http.$post('team/getTeamScheduleInfo', {
		team_id,
		currentPage,
		showCount,
		date_m: date
	})
}


//  退出团队
export function quitTeam({
	userId,
	team_id,
}) {
	return http.$post('team/quitTeam', {
		remove_userId: userId,
		team_id,

	})
}

//  移除成员
export function removeMember({
	userId,
	id,
}) {
	return http.$post('team/removeTeam', {
		remove_userId: userId,
		team_id: id
	})
}
//  创建团队
export function createMember({
	team_name,
	team_icon,
	team_desc
}) {
	return http.$post('team/save', {

		kind: "1",
		team_name,
		team_icon,
		team_desc

	})
}

// 编辑团队
export function editMember({
	team_id,
	team_name,
	team_icon,
	team_desc,
	team_coveer
}) {
	return http.$post('team/editTeam', {
		kind: "1",
		team_name,
		team_icon,
		team_desc,
		team_id,
		team_coveer
	})
}